//
//  DRSquare.m
//  opengl_practice
//
//  Created by Daruo on 2022/4/5.
//

#import "DRSquare.h"
//顶点坐标，从V0开始
const static RWTVertex vertices[] = {
    {{1.0  , -1.0 , 0},{1,0,0,1}},//V0 red
    {{1.0  , 1.0, 0},{0,1,0,1}},// V1 green
    {{-1.0,1.0, 0},{0,0,1,1}},// v2 blue
    {{-1.0,-1.0, 0},{0,0,0,0}}// v3 black
};
//索引
const static GLubyte indices[] = {
    0, 1, 2,
    2, 3, 0
};

@implementation DRSquare
-(instancetype)initWithShader:(RWTBaseEffect *)shader{
    if (self = [super initWithName:"square" shader:shader vertices:(RWTVertex*)vertices vertexCount:sizeof(vertices)/sizeof(vertices[0]) indices:(GLubyte *)indices indexCount:sizeof(indices)/sizeof(indices[0])]){
        
    }
    
    return self;
}
@end
